<?php

namespace app\admin\model;

use think\Model;


class Yee extends Model
{

    

    

    // 表名
    protected $name = 'yee';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'businessRole_text',
        'signType_text',
        'legalLicenceType_text',
        'settlementDirection_text',
        'bankAccountType_text',
        'applicationStatus_text'
    ];
    

    
    public function getBusinessroleList()
    {
        return ['SHARE_MERCHANT' => __('分账接收方'), 'SETTLED_MERCHANT' => __('入驻商户'), 'PLATFORM_MERCHANT' => __('平台商'), 'ORDINARY_MERCHANT' => __('标准商户')];
    }

    public function getSigntypeList()
    {
        return ['COMMUNITY' => __('社会团体'), 'INSTITUTION' => __('事业单位'), 'ENTERPRISE' => __('企业'), 'INDIVIDUAL' => __('个体工商户')];
    }

    public function getLegallicencetypeList()
    {
        return ['OFFICERS' => __('军官证'), 'SOLDIER' => __('士兵证'), 'TAIWAN' => __('台胞证'), 'HM_VISITORPASS' => __('港澳居民往来内地通行证'), 'PASSPORT' => __('护照'), 'ID_CARD' => __('法人身份证')];
    }

    public function getSettlementdirectionList()
    {
        return ['BANKCARD' => __('结算到银行账户'), 'ACCOUNT' => __('结算到支付账户')];
    }

    public function getBankaccounttypeList()
    {
        return ['ENTERPRISE_ACCOUNT' => __('对公账户'), 'UNIT_SETTLEMENT_CARD' => __('单位结算卡')];
    }

    public function getApplicationstatusList()
    {
        return ['COMPLETED' => __('申请已完成'), 'BUSINESS_OPENING' => __('业务开通中'), 'AGREEMENT_SIGNING' => __('协议待签署'), 'REVIEW_BACK' => __('申请已驳回'), 'REVIEWING' => __('申请审核中')];
    }


    public function getBusinessroleTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['businessRole']) ? $data['businessRole'] : '');
        $list = $this->getBusinessroleList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getSigntypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['signType']) ? $data['signType'] : '');
        $list = $this->getSigntypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getLegallicencetypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['legalLicenceType']) ? $data['legalLicenceType'] : '');
        $list = $this->getLegallicencetypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getSettlementdirectionTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['settlementDirection']) ? $data['settlementDirection'] : '');
        $list = $this->getSettlementdirectionList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getBankaccounttypeTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['bankAccountType']) ? $data['bankAccountType'] : '');
        $list = $this->getBankaccounttypeList();
        return isset($list[$value]) ? $list[$value] : '';
    }


    public function getApplicationstatusTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['applicationStatus']) ? $data['applicationStatus'] : '');
        $list = $this->getApplicationstatusList();
        return isset($list[$value]) ? $list[$value] : '';
    }




}
